<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>编辑文章</title>
<link href="/include/manage/images/main/style.css" rel="stylesheet" type="text/css" />
<link href="/include/manage/dialog/asyncbox.css" rel="stylesheet" type="text/css" />
<link href="/include/manage/fineuploader/fineuploader.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
#imageView {
	border:0;
	max-width:476px;
	max-height:355px;
	width:expression(this.width>476?'476px':this.width);
	height:expression(this.height>355?'355px':this.height);
}
.user_area{
	width:90%;border:1px solid gray;font-size:12px;
	height:80px;
}
</style>
<script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/ckeditor/ck_init.js"></script>
<script type="text/javascript" src="/ckeditor/config.js"></script>
<script type="text/javascript" src="/ckfinder/ckfinder.js"></script>
<script type="text/javascript" src="/include/manage/js/jquery.js"></script>
<script type="text/javascript" src="/include/manage/js/AsyncBox.js"></script>
<script type="text/javascript" src="/include/manage/datepicker/WdatePicker.js"></script>
<script type="text/javascript" src="/include/manage/swfupload/swfupload.js"></script>
<script type="text/javascript" src="/include/manage/swfupload/swfupload.queue.js"></script>
<script type="text/javascript" src="/include/manage/swfupload/fileprogress.js"></script>
<script type="text/javascript" src="/include/manage/swfupload/doc_handlers.js"></script>
<script src="/include/manage/fineuploader/js/header.js"></script>
<script src="/include/manage/fineuploader/js/util.js"></script>
<script src="/include/manage/fineuploader/js/button.js"></script>
<script src="/include/manage/fineuploader/js/handler.base.js"></script>
<script src="/include/manage/fineuploader/js/handler.form.js"></script>
<script src="/include/manage/fineuploader/js/handler.xhr.js"></script>
<script src="/include/manage/fineuploader/js/uploader.basic.js"></script>
<script src="/include/manage/fineuploader/js/dnd.js"></script>
<script src="/include/manage/fineuploader/js/uploader.js"></script>
<script language="javascript">
jQuery.noConflict();

jQuery.ajaxSetup ({
	cache: false
});

var swfu;
var uploadNum=0;

jQuery(function(){
	jQuery('#chooseType').click(function(){
		asyncbox.open({
			title : '选择文章频道',
			url : '/manage_type_ajax.ad?parameter=showList&checkStyle=radio',
			width : 400,
			height : 300,
			tipsbar:{
				title : '选择文章频道',
				content : '请选择文章要发布的频道'
				},
		　　btnsbar : jQuery.btn.OKCANCEL,
		　　callback : function(action,iframe){
		　　　　　if(action == 'ok'){
					var nodes = iframe.zTree1.getCheckedNodes();
					jQuery("#showType").val(nodes[0].name);
					jQuery("#stype").val(nodes[0].id);
		　　　　　}
		　　　}
		});
	});
	
	jQuery('#chooseLinkType').click(function(){
		asyncbox.open({
			title : '选择其他频道',
			url : '/manage_type_ajax.ad?parameter=showList&checkStyle=checkbox',
			width : 400,
			height : 300,
			tipsbar:{
				title : '选择其他频道',
				content : '文章可以同时引用到其他频道'
				},
		　　btnsbar : jQuery.btn.OKCANCEL,
		　　callback : function(action,iframe){
		　　　　　if(action == 'ok'){
		　　　　　　　var s='';
					var str='';
					var nodes = iframe.zTree1.getCheckedNodes();
					for(var i=0;i<nodes.length;i++){
						s+=nodes[i].name+",";
						str+=nodes[i].id+",";
					}
					jQuery("#showLinkTypes").val(s);
					jQuery("#linkTypes").val(str);
		　　　　　}
		　　　}
		});
	});
	
	jQuery('#chooseOtherType').click(function(){
		asyncbox.open({
			title : '选择其他频道',
			url : '/manage_type_ajax.ad?parameter=showList&checkStyle=checkbox',
			width : 400,
			height : 300,
			tipsbar:{
				title : '选择其他频道',
				content : '文章可以同时发布到其他频道'
				},
		　　btnsbar : jQuery.btn.OKCANCEL,
		　　callback : function(action,iframe){
		　　　　　if(action == 'ok'){
		　　　　　　　var s='';
					var str='';
					var nodes = iframe.zTree1.getCheckedNodes();
					for(var i=0;i<nodes.length;i++){
						s+=nodes[i].name+",";
						str+=nodes[i].id+",";
					}
					jQuery("#showOthers").val(s);
					jQuery("#otherTypes").val(str);
		　　　　　}
		　　　}
		});
	});
	
	jQuery('#gennews').click(function(){
		//window.parent.parent.loadTask("gennews","$!news.id",1);
		asyncbox.open({
			title : '生成文章',
			url : '/include/manage/generate_news.jsp?id=$!news.id',
			width : 400,
			height : 300,
			modal : true,
			tipsbar:{
				title : '生成文章静态文件',
				content : '注意：仅当使用网站静态化时，此功能才有效，生成过程中请不要关闭窗口'
				},
		　　btnsbar : jQuery.btn.OK,
		　　callback : function(action,iframe){
		　　　}
		});
	});
	
	try {
		createUploader();
	}catch(e){};
	
	//初始化上传组件
			var settings = {
				flash_url : "/include/manage/swfupload/swfupload.swf",
				upload_url: "/DocUpload?sid=$!thisSite.id",
				file_size_limit : "1024 MB",
				file_types : "*.doc;*.docx;*.ppt;*.pptx;*.xls;*.xlsx;*.pdf;*.mpg;*.wmv;*.wma;*.3gp;*.mov;*.mp4;*.mp3;*.asf;*.asx;*.flv;*.zip;*.rar",
				file_types_description : "文档或视频",
				file_upload_limit : 1,
				file_queue_limit : 0,
				custom_settings : {
					progressTarget : "fsUploadProgress",
					cancelButtonId : "btnCancel"
				},
				debug: false,
				// Button settings
				button_width: "52",
				button_height: "20",
				button_placeholder_id: "spanButtonPlaceHolder",
				button_text: "添加资料",
				
				moving_average_history_size: 40,
				
				// The event handler functions are defined in handlers.js
				file_queued_handler : fileQueued,
				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,
				upload_start_handler : uploadStart,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : uploadSuccess,
				upload_complete_handler : uploadComplete,
				queue_complete_handler : queueComplete	// Queue plugin event
			};

			swfu = new SWFUpload(settings);
});

function createUploader(){
    var errorHandler = function(event, id, fileName, reason) {
        qq.log("id: " + id + ", fileName: " + fileName + ", reason: " + reason);
    };

    var uploader = new qq.FineUploader({
        element: jQuery('#draguploader')[0],
		multiple: false,
        uploadButtonText: "选择文件",
        request: {
            endpoint: "/upload/receiver",
			params:{sid:'$!thisSite.id',type:'images'}
        },
        validation: {
            allowedExtensions: ['jpeg', 'jpg', 'png','bmp','gif'],
            sizeLimit: 50000
        },
        callbacks: {
            onError: errorHandler
        }
    });     
}

function removeAttach(){
	asyncbox.confirm('注意：服务器上的附件文件本身也会随之删除，您确定要删除吗？','删除附件',function(action){
		if(action == 'ok'){
			jQuery.get("/manage_news_ajax.ad" , { parameter : "removeAttach", id : "$!news.id" }, function(data){
				//zTree1.addNodes(zTree1.getSelectedNode(), [{ id:data,name:newtypename}]);
			jQuery("#fileArea")[0].innerHTML="&nbsp; <input id=\"uploadfile\" name=\"file\" type=\"text\" value=\"\"/> <input type=\"button\" value=\"浏览\" onClick=\"BrowseServer('file')\"/>";
			});
		}
	});
}

function showAttach(){
	/*
	#if($news.fileType.toLowerCase().equals("jpg.gif") || $news.fileType.toLowerCase().equals("gif.gif") || $news.fileType.toLowerCase().equals("bmp.gif") || $news.fileType.toLowerCase().equals("png.gif"))
	*/
	asyncbox.open({
		title : "预览附件",
		html : "<div align='center'><img id='imageView' src='$news.file' /></div>",
		width : 500,
		height : 400
　	});
	/*
	#end
	*/
}

function showFilter(){
}

function removeDoc(){
	asyncbox.confirm('注意：服务器上的资料连同原始文件也会随之删除，您确定要删除吗？','删除资料',function(action){
	　　　if(action == 'ok'){
			jQuery.get("/manage_news_ajax.ad" , { parameter : "removeDoc", id : "$!news.id" }, function(data){
				//zTree1.addNodes(zTree1.getSelectedNode(), [{ id:data,name:newtypename}]);
				jQuery("#docfile").val('');
				jQuery("#doctype").val('');
				jQuery("#documentfile").val('');
			});
	　　　}
	});
}

function removeField(fid,fname){
	asyncbox.confirm('注意：服务器上的附件文件本身也会随之删除，您确定要删除吗？','删除字段',function(action){
	　　　if(action == 'ok'){
			jQuery.get("/manage_news_ajax.ad" , { parameter : "removeField" , fieldid:fid }, function(data){
				//zTree1.addNodes(zTree1.getSelectedNode(), [{ id:data,name:newtypename}]);
				jQuery("#"+fid)[0].innerHTML="&nbsp; <input type=\"file\" name=\""+fname+"\" />";
			});
	　　　}
	});
}

function showField(url){
	asyncbox.open({
		title : "预览附件",
		html : "<div align='center'><img id='imageView' src='"+url+"' /></div>",
		width : 500,
		height : 400
　	});
}

var uploadTextBoxID="file";

//文件的触发
function BrowseServer(inputId){
	uploadTextBoxID =  inputId;
	var finder = new CKFinder();
	finder.basePath = '/ckfinder/'; //导入CKFinder的路径
	finder.selectActionFunction = SetFileField; //设置文件被选中时的函数
	finder.selectActionData = inputId; //接收地址的input ID
	finder.popup();
}

//文件选中时执行
function SetFileField(fileUrl,data){
	document.getElementById(uploadTextBoxID).value = fileUrl;
}

function checkForm(){
	jQuery("#Save")[0].enabled=false;
	var isok=true;
	if(jQuery("#title").val().length==0){
		alert("标题不能为空！");
		jQuery("#title")[0].focus();
		isok = false;
	}else if(jQuery("#stype").val().length==0){
		alert("频道不能为空！");
		jQuery("#stype")[0].focus();
		isok = false;
	/*
	#if(!$news.xmldata)
	*/
	}else if(CKEDITOR.instances.content.getData()==""){
		alert("内容不能为空！");
		//$("#stype")[0].focus();
		isok = false;
	/*
	#end
	*/
	}
	var type2value='';
	jQuery('input[name="t2"][checked]').each(function (){
		type2value += jQuery(this).val() + ",";
	});
	if (type2value.length > 0) {
		type2value = type2value.substr(0, type2value.length - 1);
	}
	jQuery("#type2").val(type2value);
	if(isok==true){
		if(uploadNum>0){
			uploadDocument();
		}else{
			if(jQuery("#documentfile").val().length>0){
				jQuery("#docfile").val(jQuery("#documentfile").val());
			}
			jQuery("#writeform").submit();
		}
	}
}

function uploadDocument(){
	/*
	#if($news.docfile.length()>0)
	*/
	asyncbox.confirm('注意：之前已上传了文件，您确定要删除已上传的文件吗？','删除资料',function(action){
	　　　if(action == 'ok'){
			jQuery.get("/manage_news_ajax.ad" , { parameter : "removeDoc", id : "$!news.id" }, function(data){
				//zTree1.addNodes(zTree1.getSelectedNode(), [{ id:data,name:newtypename}]);
				jQuery("#docfile").val('');
				//这里不应该清除下述字段，否则就干扰了新的上传
				//$("#doctype").val('');
				//$("#documentfile").val('');
				asyncbox.open({
					title : "预览附件",
					html : "<div id='showStatus'><div class='fieldset flash' id='fsUploadProgress'><span class='legend'></span></div><div id='divStatus'>已上传0个文件</div></div>",
					width : 500,
					height : 300
			　	});
				swfu.startUpload();
			});
	　　　}
	});
	/*
	#else
	*/
	asyncbox.open({
		title : "预览附件",
		html : "<div id='showStatus'><div class='fieldset flash' id='fsUploadProgress'><span class='legend'></span></div><div id='divStatus'>已上传0个文件</div></div>",
		width : 500,
		height : 300
	});
	swfu.startUpload();
	/*
	#end
	*/
}

function showView(url){
	var urlType=url.substring(url.lastIndexOf("."),url.length);
	if(urlType==".swf"){
		window.open("/user/admin/inc/dataview.jsp?url="+url);
	}else if(urlType==".flv"){
		window.open("/user/admin/inc/videoview.jsp?url="+url);
	}
}

function showMemberConfig(){
	jQuery("#memberConfig")[0].style.display='';
}
function hideMemberConfig(){
	jQuery("#memberConfig")[0].style.display='none';
}

function getKeywords(){
	var c=CKEDITOR.instances.content.getData();
	
	if(c==""){
		alert("内容不能为空！");
	}else{
		//c=encodeURI(c);
		jQuery.post("/manage_news_ajax.ad",{parameter:'getKeywords',content:c},function(data){
			//alert(data);
			jQuery("#keywords").val(data);
		});
	}
}
</script>
</head>
<body>
<form id="writeform" name="writeform" method="post" action="/manage_news.ad" enctype="multipart/form-data">
<input type="hidden" name="parameter" value="$!action" />
<input type="hidden" name="id" id="id" value="$!news.id" />
<input type="hidden" name="flowusers" id="flowusers" value="$!news.flowusers" />
<input type="hidden" name="treenews" id="treenews" value="#if($treenews)$!treenews#else$!news.treenews#end" />
<input type="hidden" name="order" #if($news.order) value="$!news.order"#else value="0"#end />
<input type="hidden" name="ispub" #if($news.ispub) value="$!news.ispub"#else value="0"#end />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="30" background="/include/manage/images/main/tab_05.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="30"><img src="/include/manage/images/main/tab_03.gif" width="12" height="30" /></td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="46%" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="5%"><div align="center"><img src="/include/manage/images/main/tb.gif" width="16" height="16" /></div></td>
                <td width="95%"><span class="STYLE3">当前位置</span>：[内容管理]-[编辑文章]</td>
              </tr>
            </table></td>
            <td width="54%"><table border="0" align="right" cellpadding="0" cellspacing="0">
              <tr>
              #if($news.id)
				<td width="80"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><a href="/manage_relative.ad?parameter=choosed&newsid=$!news.id"><img src="/include/manage/images/main/22.gif" width="14" height="14" /></a></div></td>
                    <td><div align="center"><a href="/manage_relative.ad?parameter=choosed&newsid=$!news.id">相关文章</a></div></td>
                  </tr>
                </table></td>
					<td width="80"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><a href="/manage_pic.ad?parameter=list&newsid=$!news.id"><img src="/include/manage/images/main/22.gif" width="14" height="14" /></a></div></td>
                    <td><div align="center"><a href="/manage_pic.ad?parameter=list&newsid=$!news.id">管理图片</a></div></td>
                  </tr>
                </table></td>
								<td width="80"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><a href="/manage_video.ad?parameter=list&newsid=$!news.id"><img src="/include/manage/images/main/22.gif" width="14" height="14" /></a></div></td>
                    <td><div align="center"><a href="/manage_video.ad?parameter=list&newsid=$!news.id">管理视频</a></div></td>
                  </tr>
                </table></td>
                <td width="60"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><a href="/manage_news.ad?parameter=add&tid=#if($tid)$!tid#else$!news.type#end&treenews=#if($treenews)$!treenews#else$!news.treenews#end"><img src="/include/manage/images/main/22.gif" width="14" height="14" /></a></div></td>
                    <td><div align="center"><a href="/manage_news.ad?parameter=add&tid=#if($tid)$!tid#else$!news.type#end&treenews=#if($treenews)$!treenews#else$!news.treenews#end">新增</a></div></td>
                  </tr>
                </table></td>
                <td width="52"><table width="88%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><a href="/manage_news.ad?parameter=delete&id=$!news.id"><img src="/include/manage/images/main/11.gif" width="14" height="14" /></a></div></td>
                    <td><div align="center"><a href="/manage_news.ad?parameter=delete&id=$!news.id">删除</a></div></td>
                  </tr>
                </table></td>
								#else
								<td width="80"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><div align="center"><a href="/manage_news.ad?parameter=list&tid=$!tid"><img src="/include/manage/images/main/22.gif" width="14" height="14" /></a></div></td>
                    <td><div align="center"><a href="/manage_news.ad?parameter=list&tid=$!tid">返回列表</a></div></td>
                  </tr>
                </table></td>
								#end
              </tr>
            </table></td>
          </tr>
        </table></td>
        <td width="16"><img src="/include/manage/images/main/tab_07.gif" width="16" height="30" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
  	<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="8" background="/include/manage/images/main/tab_12.gif">&nbsp;</td>
        <td>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#b5d6e6">
    <tr> 
      <td width="80" height="25" bgcolor="#ffffff">&nbsp;文章标题：<font color=red>*</font></td>
      <td width="300" bgcolor="#ffffff">&nbsp;
      	<input id="title" name="title" type="text" value="$!news.title" size="30" />
				<!--input type="button" name="filter" value="特效" onClick="showFilter()" /-->
      </td>
		<td width="80" height="25" bgcolor="#ffffff">&nbsp;发布时间：</td>
      <td bgcolor="#ffffff">&nbsp;
      <input name="date" type="text" value="$!news.date" class="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" /></td>
    </tr>
    <tr> 
       <td width="80" height="25" bgcolor="#ffffff">&nbsp;文章作者：</td>
       <td bgcolor="#ffffff">&nbsp;
					<input name="author" type="text" value="$!news.author" />
        </td>
				<td width="80" height="25" bgcolor="#ffffff">&nbsp;下线时间：</td>
      <td bgcolor="#ffffff">&nbsp;
      <input name="offdate" type="text" value="$!news.offdate" class="Wdate" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" /></td>
    </tr>
		<tr>
			<td height="25" bgcolor="#ffffff">&nbsp;文章来源：</td>
      <td bgcolor="#ffffff">&nbsp;
        	<input id="source" name="source" type="text" value="$!news.source" />
			</td>
        <td height="25" bgcolor="#ffffff">&nbsp;关 键 字：</td>
        <td bgcolor="#ffffff">&nbsp;
        	<input id="keywords" name="keywords" type="text" value="$!news.keywords" />
        	<input type="button" name="genkey" value="生成关键字" onclick="getKeywords()" />
        </td>
		</tr>
    <tr>
 		<td height="25" bgcolor="#ffffff">&nbsp;文章频道：<font color=red>*</font></td>
      <td bgcolor="#ffffff">&nbsp;<input type="hidden" id="stype" name="type" value="#if($tid)$!tid#else$!news.type#end" />
        <input type="text" id="showType" name="showType" value="#if($tname)$!tname#else$!news.getTypeName()#end" disabled />
        <input type="button" id="chooseType" name="chooseType" value="选择文章频道"/>
      </td>
      <td height="25" bgcolor="#ffffff">&nbsp;发 布 人：</td>
      <td bgcolor="#ffffff">&nbsp;
			#if($news.username)$!news.username#else$!username#end
      <input name="username" type="hidden" id="username" value="#if($news.username)$!news.username#else$!username#end" /></td>
    </tr>
    #if($action.equals("save"))
    <tr>
    	<td height="25" bgcolor="#ffffff">&nbsp;引用设置：</td>
        <td bgcolor="#ffffff">&nbsp;<input type="hidden" id="linkTypes" name="linkTypes" value="" />
        <input type="text" id="showLinkTypes" name="showLinkTypes" value="" disabled />
        <input type="button" id="chooseLinkType" name="chooseLinkType" value="选择其他频道"/>
        </td>
    	<td bgcolor="#ffffff">&nbsp;分发设置：</td>
        <td bgcolor="#ffffff">&nbsp;<input type="hidden" id="otherTypes" name="otherTypes" value="" />
        <input type="text" id="showOthers" name="showOthers" value="" disabled />
        <input type="button" id="chooseOtherType" name="chooseOtherType" value="选择其他频道"/>
        </td>
    </tr>
    #end
    <tr>
    	<td height="25" bgcolor="#ffffff">&nbsp;是否审核：</td>
        <td bgcolor="#ffffff">&nbsp;
        #if($pop==3||$pop==1)
        <input name="display" id="isnotdisplay" type="radio" value="0"#if($news.display)#if($news.display==0) checked#end#else checked#end /><label for="isnotdisplay">未审核</label>&nbsp;
      	<input name="display" id="isdisplay" type="radio" value="1" #if($news.display)#if($news.display==1) checked#end#end /><label for="isdisplay">已审核</label>
        #else
        	#if($news.display==1)已审核#else未审核#end<input type="hidden" name="display" #if($news.display) value="$!news.display"#else value="0"#end />
        #end
		</td>
		<td height="25" bgcolor="#ffffff">&nbsp;是否推荐：</td>
        <td bgcolor="#ffffff">&nbsp;
        #if($pop==3)
        <input name="commend" id="isnotcommend" type="radio" value="0" #if(!$news.commend) checked#end #if($news.commend=="0") checked#end /><label for="isnotcommend">未推荐</label>&nbsp;
      	<input name="commend" id="iscommend" type="radio" value="1"#if($news.commend=="1") checked#end /><label for="iscommend">已推荐</label>
        #else
        	#if($news.commend=="1")已推荐#else未推荐#end<input type="hidden" name="commend" #if($news.commend) value="$!news.commend"#else value="0"#end />
        #end
        </td>
    </tr>
		<tr>
       <td width="80" height="25" bgcolor="#ffffff">&nbsp;推送到首页：</td>
       <td bgcolor="#ffffff">&nbsp;
     	<select name="tofront" id="tofront">
          <option value="0" #if($news.tofront==0) selected #end>否</option>
          <option value="1" #if($news.tofront==1) selected #end>是</option>
        </select></td>
    	<td rowspan="2" bgcolor="#ffffff">&nbsp;文章摘要：</td>
       <td rowspan="2" bgcolor="#ffffff">
        	<div style="margin:4px;"><textarea class="user_area" name="summary">$!news.summary</textarea></div>
        </td>
		</tr>
    <tr>
    	<td width="80" height="25" bgcolor="#ffffff">&nbsp;二维分类：</td>
        <td bgcolor="#ffffff">
					<input type="hidden" id="type2" name="type2" value="$!news.type2" />
					<script language="javascript">
					jQuery(function(){
					/*
					#if($news.type2)
					#set($type2=$news.type2.split(","))
					#foreach($atype2 in $type2)
					*/
						jQuery("input[value='$!atype2']").attr('checked','checked');
					/*
					#end
					#end
					*/
						//jQuery("#test1").attr('checked','checked');
					});
					</script>
					#set($i=1)
					#foreach($atype2 in $type2List)
						<input id="type2_$!atype2.id" type="checkbox" name="t2" value="$!atype2.name" /><label for="type2_$!atype2.id">$!atype2.name</label>&nbsp;
						#if($i%2==0)<br/>#end
						#set($i=$i+1)
					#end
        </td>
    </tr>
		<tr>
				<td width="80" height="25" bgcolor="#ffffff">&nbsp;是否会员：</td>
        <td bgcolor="#ffffff">&nbsp;
        	<input name="isfee" onClick="hideMemberConfig()" id="isnotmember" type="radio" value="0"#if(!$news.isfee) checked#end#if($news.isfee=="0") checked#end /><label for="isnotmember">非会员</label>&nbsp;
      		<input name="isfee" onClick="showMemberConfig()" id="ismember" type="radio" value="1"#if($news.isfee=="1") checked#end /><label for="ismember">会员</label>
        </td>
				<td width="80" height="25" bgcolor="#ffffff">&nbsp;需要搜索到:</td>
				<td bgcolor="#ffffff">&nbsp;
					<input id="issearch" type="radio" name="search" value="0"#if(!$news.search) checked#end#if($news.search=="0") checked#end /><label for="issearch">是</label>&nbsp;
					<input id="isnotsearch" type="radio" name="search" value="1"#if($news.search=="1") checked#end /><label for="isnotsearch">否</label>
				</td>
		</tr>
		<tr id="memberConfig" style="display:#if($news.isfee=="1")#else none #end;">
				<td width="80" height="25" bgcolor="#ffffff">&nbsp;会员权限：</td>
        <td bgcolor="#ffffff">&nbsp;
					#if($news.rights)
        	<input name="rights" type="text" value="$news.rights" />
					#else
					<input name="rights" type="text" value="0" />
					#end
        </td>
				<td width="80" height="25" bgcolor="#ffffff">&nbsp;资源积分：</td>
        <td bgcolor="#ffffff">&nbsp;
					#if($news.score)
        	<input name="score" type="text" value="$news.score" />
					#else
					<input name="score" type="text" value="0" />
					#end
        </td>
		</tr>
    <tr>
      <td width="80" height="25" bgcolor="#ffffff">&nbsp;文章附件：</td>
      <td bgcolor="#ffffff" id="fileArea">&nbsp;
      <input id="file" name="file" type="text" value="$!news.file"/>
      #if($news.file)
      #if($news.file.length()>0)
        #if($news.fileType)
      		<a href="javascript:showAttach()" title="预览"><img src="/include/system/filetype/$news.fileType.toLowerCase()" align="absmiddle"/></a>
        #end
        <a href="javascript:removeAttach()" title="删除"><img src="/include/manage/images/main/del.gif" width="16" height="16" align="absmiddle" /></a>
      #end
      #else
      	<!--input type="file" name="uploadfile" /-->
      #end
      	<input type="button" value="浏览" onClick="BrowseServer('file')"/>
       </td>
    	<td width="80" height="25" bgcolor="#ffffff">&nbsp;上传大附件：</td>
        <td bgcolor="#ffffff">
        	<div style="margin:4px;">
        	<input id="docfile" type="hidden" name="docfile" value="$!news.docfile" />
            <input id="doctype" type="hidden" name="doctype" value="$!news.doctype" />
            <div style="float:left;width:160px;"><input type="text" id="documentfile" name="documentfile" value="$!news.docfile" /></div>
            <div style="width:50px;height:22px;float:left;border:1px solid gray;margin-left:4px"><span id="spanButtonPlaceHolder"></span></div>
        	#if($news.docfile)
        	#if($news.docfile.length()>0)
            	<input type="button" name="preview" value="预览" onClick="showView('$!news.docfile')" />
                <a href="javascript:removeDoc()" title="删除"><img src="/include/manage/images/main/del.gif" width="16" height="16" align="absmiddle" /></a>
            #end
            #end
            </div>
        </td>
    </tr>
<!--自定义表单-->
#if($fieldList)
	#foreach($field in $fieldList)
    <tr>
      <td width="80" height="25" bgcolor="#ffffff">&nbsp;$!field.label：</td>
      <td colspan="3" bgcolor="#ffffff" id="$!field.id">&nbsp;
      	#if($field.type.equals("text"))
      		<input name="u_$!field.name" type="text" value="#if($field.userValue)$!field.userValue#else$!field.value#end" />
        #end
        #if($field.type.equals("textarea"))
        	<textarea class="user_area" name="u_$!field.name">#if($field.userValue)$!field.userValue#else$!field.value#end</textarea>
        #end
        #if($field.type.equals("radio"))
        	#foreach($item in $field.value.split("\\n"))
            	<input name="u_$!field.name" type="radio" value="$!item" #if($field.userValue.equals($item)) checked #end /> $!item &nbsp;
            #end
        #end
        #if($field.type.equals("checkbox"))
        	#foreach($item in $field.value.split("\\n"))
            	<input name="u_$!field.name" type="checkbox" value="$!item" #if($field.userValue.equals($item)) checked #end /> $!item &nbsp;
            #end
        #end
        #if($field.type.equals("select"))
        	<select name="u_$!field.name">
        	#foreach($item in $field.value.split("\\n"))
            	<option value="$!item" #if($field.userValue.equals($item)) selected #end>$!item</option>
            #end
            </select>&nbsp;
        #end
        <!--文件判断这块还需要单独处理-->
      	#if($field.type.equals("file"))
        	<!--input name="u_$!field.name" type="hidden" value="$!field.value" /-->
            <input id="u_$!field.name" name="u_$!field.name" type="text"
            #if($field.userValue) value="$!field.userValue"#else value="$!field.value"#end
             />
              #if($field.value || $field.userValue)
              #if($field.value.length()>0 || $!field.userValue.length()>0)
                <a href="javascript:showField('$!field.userValue')" title="预览"><img src="/include/manage/images/main/images.gif" align="absmiddle"/></a>
                <a href="javascript:removeField('$!field.id','u_$!field.name')" title="删除"><img src="/include/manage/images/main/del.gif" width="16" height="16" align="absmiddle" /></a>
              #end
              #end
              <input type="button" value="浏览" onClick="BrowseServer('u_$!field.name')"/>
        #end
		#if($field.type.equals("pic"))
              #if($field.userValue)
              #if($!field.userValue.length()>0)
			  	<a href="javascript:showField('$!field.userValue')" title="预览">$!field.userValue</a>
                <a href="javascript:showField('$!field.userValue')" title="预览"><img src="/include/manage/images/main/images.gif" align="absmiddle"/></a>
                <a href="javascript:removeField('$!field.id','u_$!field.name')" title="删除"><img src="/include/manage/images/main/del.gif" width="16" height="16" align="absmiddle" /></a>
				#else
				<div id="draguploader" class="unstyled"></div><span id="triggerUpload" class="btn btn-primary">Upload Queued Files</span>
              #end
			  #else
			  	<div id="draguploader" class="unstyled"></div><span id="triggerUpload" class="btn btn-primary">Upload Queued Files</span>
              #end
			  
			#if($field.require.equals("1"))
        	<font color="red">*</font>
			#end
			#set($p=1)
			#if($field.value.trim().length()>0)
			#foreach($item in $field.value.trim().split("\\n"))
				#if($p==1) 宽:#else 高:#end
				$!item px
				#set($p=$p+1)
			#end
			#end
        #end
        #if($field.type.equals("html"))
        	<textarea id="u_$!field.name" class="user_html" name="u_$!field.name">#if($field.userValue)$!field.userValue#else$!field.value#end</textarea>
        	<script type="text/javascript">
			//<![CDATA[
			try{
				var editor_$!field.name = CKEDITOR.replace( 'u_$!field.name', {
					skin : 'office2003',
					filebrowserImageUploadUrl:'/FileUpload?sid=$!thisSite.id&type=images',
					filebrowserFlashUploadUrl:'/FileUpload?sid=$!thisSite.id&type=flash'
				});
				CKFinder.setupCKEditor( editor_$!field.name, '/ckfinder/' );
			}catch(e){}
			//]]>
			</script>
        #end
        #if($field.require.equals("1"))
        	<font color="red">*</font>
        #end
      </td>
    </tr>
    #end
#end
<!--/自定义表单-->
    <tr>
    	#set($out=0)
    	#if($news.xmldata)
	    	#if($news.xmldata.length()>0)
	    		#set($out=1)
	    	#end
    	#end
    	#if($out==1)
    	<td bgcolor="#ffffff">外部数据</td>
    	<td colspan="3" bgcolor="#ffffff">
    		<textarea name="xmldata" cols="55" rows="18" style="width:100%" id="xmldata">$!news.xmldata</textarea>
      		<input type="hidden" name="content" value="$!news.content" />
      	</td>
      	#else
      <td colspan="4" bgcolor="#ffffff">
      	<textarea name="content" cols="55" rows="18" style="width:100%" id="content">$!news.content</textarea>
			<script type="text/javascript">
			//<![CDATA[
			try {
				var editor = CKEDITOR.replace('content', {
					skin: 'office2003',
					filebrowserImageUploadUrl: '/FileUpload?sid=$!thisSite.id&type=images',
					filebrowserFlashUploadUrl: '/FileUpload?sid=$!thisSite.id&type=flash'
				/*toolbar:[
		 ['Source','Cut','Copy','Paste','PasteText','PasteFromWord'],
		 ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
		 ['Image','Flash','Table','HorizontalRule'],
		 '/',
		 ['Styles','Format'],
		 ['Bold','Italic','Strike'],
		 ['Link','Unlink','Anchor']
		 ]*/
				});
				CKFinder.setupCKEditor(editor, '/ckfinder/');
			}catch(e){}
			//]]>
			</script>
      </td>
      	#end
    </tr>
</table>
		</td>
        <td width="8" background="/include/manage/images/main/tab_15.gif">&nbsp;</td>
      </tr>
    </table></td>
    </tr>
  <tr>
    <td height="35" background="/include/manage/images/main/tab_19.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="35"><img src="/include/manage/images/main/tab_18.gif" width="12" height="35" /></td>
        <td valign="top"><div align="center"> 
		#if($pop==0)
        	<input id="Save" type="button" name="Save" value="保存" onClick="checkForm()"/>
        #elseif($pop==1)
        	<input id="Save" type="button" name="Save" value="审核" onClick="checkForm()"/>
		#else
			<input id="Save" type="button" name="Save" value="发布" onClick="checkForm()"/>
		#end
			&nbsp; &nbsp; 
		#if($pop>0)
		#if($action=="update")
			<input type="reset" name="Reset" value="重写"/>
		#else
			<input type="reset" name="Reset" value="清空"/>
		#end
		#end
		#if($pop>=1)
			&nbsp; &nbsp; 
			<input type="button" name="Cancel" value="撤销" onClick="location.href='/manage_news.ad?parameter=noDisplay&id=$!news.id'"/>
		#end
		#if($action=="update")
			&nbsp; &nbsp; 
			<input type="button" id="Review" name="Review" value="预览" onClick="window.open('/news.do?parameter=preview&id=$!news.id')" /> 
			#if($thisSite.html==1)
			#if($pop==1)
			&nbsp; &nbsp;
			<input type="button" id="gennews" name="generate" value="发布"/>
			#elseif($pop>1)
			&nbsp; &nbsp;
			<input type="button" id="gennews" name="generate" value="生成"/>
			#end
			#end
		#end
		&nbsp; &nbsp;
		<input id="Return" type="button" name="Return" value="返回" onClick="history.back(-1)"/>
        </div></td>
        <td width="16"><img src="/include/manage/images/main/tab_20.gif" width="16" height="35" /></td>
      </tr>
    </table>
	</td>
  </tr>
</table>
  </form>
</body>
</html>
#if($msg)
<script>
alert('$!msg');
</script>
#end